]>
Commit | Line | Data |
---|---|---|
fc2c0542 RBR |
1 | import Foundation |
2 | import Cocoa | |
3 | ||
4 | class BackgroundView: QSBezelBackgroundView { | |
5 | ||
6 | override func draw(_ rect: NSRect) { | |
768e492e | 7 | let boundsRect = bounds |
fc2c0542 RBR |
8 | |
9 | let roundRect = NSBezierPath() | |
10 | roundRect.appendRoundedRect(boundsRect, xRadius: 8.0, yRadius: 8.0) | |
11 | roundRect.addClip() | |
12 | ||
768e492e | 13 | let darkMode = effectiveAppearance.name == .darkAqua |
fc2c0542 RBR |
14 | if (darkMode) { |
15 | NSColor(red: 0.1, green: 0.1, blue: 0.1, alpha: 0.99).setFill() | |
16 | } else { | |
17 | NSColor(red: 1, green: 1, blue: 1, alpha: 0.99).setFill() | |
18 | } | |
19 | boundsRect.fill(using: .copy) | |
20 | ||
21 | super.draw(boundsRect) | |
22 | } | |
23 | } |